package com.sqfw.project.wpReport.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.sqfw.framework.aspectj.lang.annotation.Log;
import com.sqfw.framework.aspectj.lang.enums.BusinessType;
import com.sqfw.project.wpReport.domain.TagReport;
import com.sqfw.project.wpReport.service.ITagReportService;
import com.sqfw.framework.web.controller.BaseController;
import com.sqfw.common.utils.poi.ExcelUtil;
import com.sqfw.framework.web.page.TableDataInfo;

/**
 * 工单标签统计表Controller
 * 
 * @author lx
 * @date 2023-08-03
 */
@RestController
@RequestMapping("/wpReport/tagReport")
public class TagReportController extends BaseController
{
    @Autowired
    private ITagReportService tagReportService;

    /**
     * 查询工单标签统计表列表
     */
    @PreAuthorize("@ss.hasPermi('getTagReportList')")
    @GetMapping("/getTagReportList")
    public TableDataInfo getTagReportList(TagReport tagReport)
    {
        startPage();
        List<TagReport> list = tagReportService.getTagReportList(tagReport);
        return getDataTable(list);
    }

    /**
     * 导出工单标签统计表列表
     */
    @Log(title = "工单标签统计表", businessType = BusinessType.EXPORT)
    @PreAuthorize("@ss.hasPermi('tagReport:export')")
    @PostMapping("/export")
    public void export(HttpServletResponse response, TagReport tagReport)
    {
        List<TagReport> list = tagReportService.getTagReportList(tagReport);
        ExcelUtil<TagReport> util = new ExcelUtil<TagReport>(TagReport.class);
        util.exportExcel(response, list, "工单标签统计表数据");
    }
}
